package com.csun.dsms.service.impl;

import com.csun.dsms.comment.core.support.BaseService;
import com.csun.dsms.mapper.DsmsAreaMapper;
import com.csun.dsms.mapper.DsmsAreaUnitMapper;
import com.csun.dsms.mapper.YcDeviceMapper;
import com.csun.dsms.model.domain.DsmsArea;
import com.csun.dsms.model.domain.DsmsAreaUnit;
import com.csun.dsms.model.domain.YcDevice;
import com.csun.dsms.model.vo.AreaUnitVo;
import com.csun.dsms.service.DsmsAreaService;
import com.csun.dsms.service.YcDeviceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class YcDeviceServiceImpl extends BaseService<YcDevice> implements YcDeviceService {

    @Resource
    private YcDeviceMapper ycDeviceMapper;

    @Override
    public Integer addDevice(YcDevice ycDevice) {
        return ycDeviceMapper.insert(ycDevice);
    }

    @Override
    public List<YcDevice> query(YcDevice ycDevice) {
        return ycDeviceMapper.queryListWithPage(ycDevice);
    }

    @Override
    public Integer deleteDevice(Long id) {
        return ycDeviceMapper.deleteByPrimaryKey(id);
    }

    @Override
    public Integer updateDevice(YcDevice ycDevice) {
        return ycDeviceMapper.updateByPrimaryKeySelective(ycDevice);
    }
}
